/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.server.modules.sys.service.juhe.usedcar;

import com.server.common.persistence.Page;
import com.server.common.service.CrudService;
import com.server.modules.sys.dao.juhe.usedcar.JuheUsedcarCityDao;
import com.server.modules.sys.entity.juhe.usedcar.JuheUsedcarCity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 聚合二手车接口地区城市数据Service
 * @author 丁光彪
 * @version 2017-01-06
 */
@Service
@Transactional(readOnly = true)
public class JuheUsedcarCityService extends CrudService<JuheUsedcarCityDao, JuheUsedcarCity> {
	@Transactional(readOnly = false)
	public  boolean saveCitys(List<JuheUsedcarCity> list){
		if(!CollectionUtils.isEmpty(list)){
			for (JuheUsedcarCity juheUsedcarCity : list) {
                String id = juheUsedcarCity.getId();
                juheUsedcarCity.preInsert();
                juheUsedcarCity.setId(id);
				dao.insert(juheUsedcarCity);
			}
			return true;
		}
		return  false;
	}

	public JuheUsedcarCity get(String id) {
		return super.get(id);
	}
	
	public List<JuheUsedcarCity> findList(JuheUsedcarCity juheUsedcarCity) {
		return super.findList(juheUsedcarCity);
	}
	
	public Page<JuheUsedcarCity> findPage(Page<JuheUsedcarCity> page, JuheUsedcarCity juheUsedcarCity) {
		return super.findPage(page, juheUsedcarCity);
	}
	
	@Transactional(readOnly = false)
	public void save(JuheUsedcarCity juheUsedcarCity) {
		super.save(juheUsedcarCity);
	}
	
	@Transactional(readOnly = false)
	public void delete(JuheUsedcarCity juheUsedcarCity) {
		super.delete(juheUsedcarCity);
	}
	
}